Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-equal-shallow

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-equal-shallow

Does a shallow comparison of two objects, returning false if the keys or values differ.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is is-equal-shallow?

The is-equal-shallow npm package is designed to perform shallow equality checks on objects or arrays. It is particularly useful when you need to quickly determine if two objects have the same top-level properties without deeply traversing their structures. This can be especially handy in optimizations where deep equality checks are too costly in terms of performance.

What are is-equal-shallow's main functionalities?

Shallow equality check for objects

This feature allows you to compare two objects to see if they have the same top-level properties and values. It's useful for checking if objects are 'equivalent' without considering nested properties.

{"const isEqualShallow = require('is-equal-shallow');\nconst obj1 = { a: 1, b: 2 };\nconst obj2 = { a: 1, b: 2 };\nconsole.log(isEqualShallow(obj1, obj2)); // true"}

Shallow equality check for arrays

Similar to objects, this feature enables shallow comparison of two arrays to determine if they contain the same elements in the same order, without going into nested arrays or objects.

{"const isEqualShallow = require('is-equal-shallow');\nconst arr1 = [1, 2, 3];\nconst arr2 = [1, 2, 3];\nconsole.log(isEqualShallow(arr1, arr2)); // true"}

Other packages similar to is-equal-shallow

Keywords

FAQs

Package last updated on 23 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc